Conversation
…neric, UserStory: 8747
…m one by one without the user having to specify them
…roperly use the structure in main
Suggestion to code highlight command parameters
New -i flag for files
…ven, so given commands will have to follow the proper command structure instead of only supplying a model
Changing where we send form data to now send the new structure
Reflects page delete example properly, fixes #10
Fixes #5
Fixes #6
Adding proper content-type header for database command
Enable raw flag functionality for files
Adding short explanation of what the CLI is and can be used for in simpler terms.
There was a problem hiding this comment.
Pull request overview
This PR introduces a v2/beta overhaul of the DynamicWeb CLI focused on automation-first usage: OAuth client-credentials authentication, consistent --output json envelopes across API-driven commands, expanded file operations (delete/copy/move), and updated documentation/changelog to reflect the new behaviors.
Changes:
- Add OAuth client-credentials support (
--auth oauth,dw login --oauth, env-var based client ID/secret) and surface auth type in the basedwcommand. - Add structured JSON output (
--output json, deprecated--json) toenv,login,files,query, andcommand. - Expand
dw fileswith destructive/mutating operations (--delete,--empty,--copy,--move) and update docs/README/changelog for v2.
Reviewed changes
Copilot reviewed 4 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Rewrites README for v2 beta: OAuth, JSON output, files workflows, CI/CD guidance. |
| package.json | Bumps version to 2.0.0-beta.0. |
| package-lock.json | Updates lockfile version metadata to 2.0.0-beta.0. |
| cliv2-documentation.md | Adds full v2 documentation article covering auth, JSON envelopes, command refs. |
| CHANGELOG.md | Adds v2 beta changelog entries for breaking changes/features/improvements. |
| bin/index.js | Adds global OAuth flags and improves base command display (incl. auth type). |
| bin/commands/env.js | Adds --output json support and restructures env command output/error handling. |
| bin/commands/login.js | Adds OAuth login/config flow and JSON envelope support. |
| bin/commands/query.js | Adds --output json, structured output envelope, and improved error propagation. |
| bin/commands/command.js | Adds --output json and structured output envelope. |
| bin/commands/files.js | Adds JSON output, deprecated flag aliases, and new delete/copy/move operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…de, improve error handling - Login: block interactive prompts in JSON mode; add non-interactive OAuth login path; always apply --host override on existing environments - Files: skip full-export confirmation in JSON mode - Command: throw error for unimplemented --list instead of returning string - Login: extract shared OAuth finalization into finalizeOAuthLogin helper - Install: add JSON output example to README for documentation consistency - Docs: include install in --output json command lists
Patch release fixing TypeError in uploadFiles when called from install command without a structured output object.
Fix/install output envelope
…or testability - Export parseHostInput, getQueryParams, buildInteractiveQueryParams, buildQueryParamsFromArgv, extractQueryPropertyPrompts, getFieldNameFromPropertyPrompt, parseCookies, shouldUseOAuth, resolveOAuthConfig, prepareDownloadCommandData, isFilePath, wildcardToRegExp, getFilesOperation from their respective modules - Add setConfigForTests() to config.js and guard getConfig() against null return - Inject deps (interactiveEnvFn, getPropertiesFn, promptFn) via optional deps param in setupEnv and getQueryParams for easier unit testing - Add test/ suite covering command, env, files, login, query, and utility helpers - Add qa/ smoke harness (run-smoke.mjs) with fixtures, profile.example.json, and README covering saved-env and ephemeral CI flows against a real DynamicWeb solution - Wire npm run test (node --test) and npm run qa:smoke scripts in package.json - Bump version to 2.0.0-beta.1 - Ignore qa/artifacts/ and qa/profile.json in .gitignore
…files; add tests for JSON parsing and formatting functions
…strap, and QA docs - Remove duplicate parseJsonSafe declaration in files.js (caused SyntaxError on startup) - Allow dw login --oauth --host to work from a clean state by deriving env name from hostname - Guard finalizeOAuthLogin against undefined env entry in config - Add PowerShell env var instructions to qa/README.md
Introduces `dw folders <folderPath>` for unambiguous directory management: --create and --rename via DirectorySave, --move via DirectoryMove, --delete/--copy/--export routed through handleFiles (now exported). Updates README and cliv2-documentation with full command reference.
…fter interactive login
Member
Author
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
--oauthlogin flow,--authflag to override auth mode, env-var-based client credentials (--clientIdEnv/--clientSecretEnv)--output jsonacross all commands with consistent response envelope (ok,status,data,errors,meta), replacing the deprecated--jsonflag--delete,--copy,--movesupport with--asFile/--asDirectoryoverrides and interactive confirmation for destructive actionsoutput.finish()viafinallyblocks, extractedisFilePathhelper, encapsulated meta access in output objects, verbose logging for archive cleanup errors, fixed missingoutputparameter threading throughsetupEnv/interactiveEnv/interactiveOAuthLoginQA test scripts
To run the unit tests:
npm testFor QA to run the test smoke harness against a real solution:
Full instructions (profile format, CI usage, --mode flag, etc.) are in qa/README.md.
https://github.com/dynamicweb/CLI/blob/7ce694f8464dd53c659f26d1950d6fc947b8aebd/qa/README.md
Test plan
dwwith no args — verify environment status display, including when env is missingdw login --oauth— verify interactive OAuth setup stores config correctlydw query <name> --output json— verify clean JSON output with no console noisedw files --delete <path>— verify confirmation prompt and correct API calldw files --copy <src> --output json— verify JSON envelopedw files --export <path> -v— verify verbose log shows correct operation context--output jsonand--interactiveconflict on the query command--jsonflag on files command emits warning and still works